class Dog(object):
    def __init__(self):
        print("---init---start")
        print(self)
        print("---init---end")

    def __del__(self):
        print("---del---")

    def __str__(self):
        print("---str---")
        return "对象的描述信息"

    def __new__(cls):  # cls此时是Dog指向的那个类对象
        print("new %d" % id(cls))
        print("---new---")
        print(object.__new__(cls))
        return object.__new__(cls)


print(id(Dog))
xtq = Dog()

# 结果
'''
51603344
new 51603344
---new---
---init---
---del---
'''
